// Any JS object will do; we're using it as a dict.
var ww_uncollapsedDict = new Array(1);

// Is a note collapsed?
function ww_collapsedp(id) {
    return !ww_uncollapsedDict[id];
}

// Toggle a note's collapsed status in the dict
function ww_toggleCollapsed(id) {
    ww_uncollapsedDict[id] = !ww_uncollapsedDict[id];
}

// Collapse or expand a note
function ww_note_toggle(id) {
    var note = document.getElementById(id);
    var note_small = document.getElementById(id+"_small");
    var note_full = document.getElementById(id+"_full");

    if (ww_collapsedp(id)) {	// EXPAND
	note_full.style.display = "inline";
	note.style.display = "block";
	note.style.padding = "0.5em";
	note.style.border = "1px solid black";
	note.style.marginTop = "6pt";
    } else {			// COLLAPSE
	note_full.style.display = "none";
	note.style.display = "inline";
	note.style.padding = "0em";
	note.style.border = "none";
	note.style.marginTop = "1pt";
    }

    ww_toggleCollapsed(id);
}
